package cn.net.dpi.core.constant;

import lombok.Getter;


@Getter
public enum GlobalDelete {
    NOT_DELETED("未删除", 0),

    DELETED("已删除", 1);

    private final String key;
    private final Integer value;

    GlobalDelete(String key, Integer value) {
        this.key = key;
        this.value = value;
    }

    public static String getKey(Integer value) {
        for (GlobalDelete as : GlobalDelete.values()) {
            if (as.getValue().equals(value)) {
                return as.getKey();
            }
        }

        return null;
    }
}
